package sketch.earlyproc;


import java.util.Vector;

import sketch.doc.usketch.Document;
import sketch.doc.usketch.Stroke;
import sketch.geo.gPoints;
import sketch.geo.gPoint;

public class EarlyProcessor {
	
	private static EarlyProcessor instance = null;
	
	private Stroke source;
	
	private EarlyProcessor() {
		
	}
	
	public static EarlyProcessor getInstance() {
		if (instance == null)
			instance = new EarlyProcessor();
		return instance;
	}
	
	public static void clear() {
		instance = new EarlyProcessor();
	}
	
	public void setStroke(Stroke s) {
		source = s;
	}
	
	public void process() {
		/**
		 * TODO: needed to be updated
		 */
		
		/**
		 * for test
		 * TODO: the problem is that the absCos + absSin != 1
		 */
		
	
		/*
		FPDetector fp = FPDetector.getInstance();
		fp.setPoints(source.getPoints());
		
		Vector<gPoints> gps = fp.getFragments();
		
		Document doc = source.getDocument();
		PSGenerator gen = PSGenerator.getInstance();
		gen.setDocument(doc);
		
		Vector<PrimSymbol> ps = new Vector<PrimSymbol>();
		for (gPoints gs : gps) {
			gen.setPoints(gs);
			gen.generate();
			ps.add(gen.getResult());
		}
		// add prims to stroke
		int[] prims = new int[ps.size()];
		for (int i = 0; i < ps.size(); i++) {
			prims[i] = ps.get(i).getElement().getId();
		}
		source.setPrimSymbolIndexArray(prims);
		*/
	}
	
	public void resample(){

	}

}
